package com.projrct;

import javax.swing.*;
import java.io.FileReader;
import java.util.Properties;

public class ClassPractice {
    public static void main(String[] args) {
        Properties p = new Properties();
        try {
            p.load(new FileReader("Class8_24/src/user.txt"));
        }catch (Exception e){
            System.out.println("文件不存在");
        }
        String inputNum = JOptionPane.showInputDialog(null,"输入账号");
        String inputPwd = JOptionPane.showInputDialog(null,"输入密码");
        if (p.getProperty("userName").equals(inputNum)&&p.getProperty("pwd").equals(inputPwd)){
            JOptionPane.showMessageDialog(null,"登录成功");
        }else {
            JOptionPane.showMessageDialog(null,"登录失败");
        }







    }
}
